package sd.zhr.moodcapsule.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sd.zhr.moodcapsule.mapper.UserMapper;
import sd.zhr.moodcapsule.pojo.User;

import java.util.List;

@Service
public class UserServiceImpl {
    @Autowired
    UserMapper userMapper;

    public List<User> getAllUsers() {
        return userMapper.getAllUser();
    }
    public int updateUser(User user) {
        return userMapper.updateByPrimaryKey(user);
    }
    //逻辑删除ys
    public int updateValid(User user) {
        return userMapper.updateValid(user);
    }
    //直接删除
    public int deleteUser(int id) {
        return userMapper.deleteByPrimaryKey(id);
    }
}
